<!DOCTYPE html>
<html lang="en">
<head>
	<meta charset="UTF-8">
	<title>登录</title>
	<script type="text/javascript" src="__STATIC__/js/jquery.js"></script>
</head>
<body>

	<center>

		用户名：<input type="text" name="u_name"/><br>
		密码：<input type="password" name="u_pwd"/><br>
		<input type="button" name="" value="登录" id="login">

	</center>
	
</body>
</html>
<script type="text/javascript">

	$(function(){

		$(document).on("click","#login",function(){

			var u_name = $("[name='u_name']").val();
			var u_pwd = $("[name='u_pwd']").val();

			$.ajax({

				url: "{:url('home/login/login')}",
				type: "POST",
				dataType: 'JSON',
				data: {u_name:u_name,u_pwd:u_pwd},
				success:function(msg){
					if(msg == 1){
						alert("登录成功");
						window.location.href = "{:url('home/base/getnode')}";
					}else{
						alert("用户名或密码错误");
					}
				},
				error:function(){
					alert("服务器有误");
				}

			});

		});

	})




</script>